package cn.mrwangyin.proxy.demo.mapper;

import cn.mrwangyin.proxy.demo.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Select({"SELECT  o.order_no,SUM(oi.price * oi.count) as amount FROM t_order o left join  t_order_item oi on o.order_no = oi.order_no group by o.order_no"})
    List<Order> listOrderAmount();
}
